import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { CollageAccountDetailLogVO, CollageAccountDetailLogForm, CollageAccountDetailLogQuery } from '@/api/system/collageAccountDetailLog/types';

/**
 * 查询拼团结算子账单详情记录列表
 * @param query
 * @returns {*}
 */

export const listCollageAccountDetailLog = (query?: CollageAccountDetailLogQuery): AxiosPromise<CollageAccountDetailLogVO[]> => {
  return request({
    url: '/system/collageAccountDetailLog/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询拼团结算子账单详情记录详细
 * @param id
 */
export const getCollageAccountDetailLog = (id: string | number): AxiosPromise<CollageAccountDetailLogVO> => {
  return request({
    url: '/system/collageAccountDetailLog/' + id,
    method: 'get'
  });
};

/**
 * 新增拼团结算子账单详情记录
 * @param data
 */
export const addCollageAccountDetailLog = (data: CollageAccountDetailLogForm) => {
  return request({
    url: '/system/collageAccountDetailLog',
    method: 'post',
    data: data
  });
};

/**
 * 修改拼团结算子账单详情记录
 * @param data
 */
export const updateCollageAccountDetailLog = (data: CollageAccountDetailLogForm) => {
  return request({
    url: '/system/collageAccountDetailLog',
    method: 'put',
    data: data
  });
};

/**
 * 删除拼团结算子账单详情记录
 * @param id
 */
export const delCollageAccountDetailLog = (id: string | number | Array<string | number>) => {
  return request({
    url: '/system/collageAccountDetailLog/' + id,
    method: 'delete'
  });
};
